package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.BusiMplstpRouteMapper;
import com.ruoyi.net.domain.BusiMplstpRoute;
import com.ruoyi.net.service.IBusiMplstpRouteService;

/**
 * 业务-mplstp-路径配置Service业务层处理
 * 
 * @author net
 * @date 2024-11-27
 */
@Service
public class BusiMplstpRouteServiceImpl implements IBusiMplstpRouteService 
{
    @Autowired
    private BusiMplstpRouteMapper busiMplstpRouteMapper;

    /**
     * 查询业务-mplstp-路径配置
     * 
     * @param id 业务-mplstp-路径配置主键
     * @return 业务-mplstp-路径配置
     */
    @Override
    public BusiMplstpRoute selectBusiMplstpRouteById(String id)
    {
        return busiMplstpRouteMapper.selectBusiMplstpRouteById(id);
    }

    /**
     * 查询业务-mplstp-路径配置列表
     * 
     * @param busiMplstpRoute 业务-mplstp-路径配置
     * @return 业务-mplstp-路径配置
     */
    @Override
    public List<BusiMplstpRoute> selectBusiMplstpRouteList(BusiMplstpRoute busiMplstpRoute)
    {
        return busiMplstpRouteMapper.selectBusiMplstpRouteList(busiMplstpRoute);
    }

    /**
     * 新增业务-mplstp-路径配置
     * 
     * @param busiMplstpRoute 业务-mplstp-路径配置
     * @return 结果
     */
    @Override
    public int insertBusiMplstpRoute(BusiMplstpRoute busiMplstpRoute)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(busiMplstpRoute.getId())) {
            busiMplstpRoute.setId(uuid);
        }
        busiMplstpRoute.setCreateBy(SecurityUtils.getUsername());
        busiMplstpRoute.setCreateTime(DateUtils.getNowDate());
        busiMplstpRoute.setUpdateBy(SecurityUtils.getUsername());
        busiMplstpRoute.setUpdateTime(DateUtils.getNowDate());
        return busiMplstpRouteMapper.insertBusiMplstpRoute(busiMplstpRoute);
    }

    /**
     * 修改业务-mplstp-路径配置
     * 
     * @param busiMplstpRoute 业务-mplstp-路径配置
     * @return 结果
     */
    @Override
    public int updateBusiMplstpRoute(BusiMplstpRoute busiMplstpRoute)
    {
        busiMplstpRoute.setUpdateBy(SecurityUtils.getUsername());
        busiMplstpRoute.setUpdateTime(DateUtils.getNowDate());
        return busiMplstpRouteMapper.updateBusiMplstpRoute(busiMplstpRoute);
    }

    /**
     * 批量删除业务-mplstp-路径配置
     * 
     * @param ids 需要删除的业务-mplstp-路径配置主键
     * @return 结果
     */
    @Override
    public int deleteBusiMplstpRouteByIds(String[] ids)
    {
        return busiMplstpRouteMapper.deleteBusiMplstpRouteByIds(ids);
    }

    /**
     * 删除业务-mplstp-路径配置信息
     * 
     * @param id 业务-mplstp-路径配置主键
     * @return 结果
     */
    @Override
    public int deleteBusiMplstpRouteById(String id)
    {
        return busiMplstpRouteMapper.deleteBusiMplstpRouteById(id);
    }
}
